package com.ffms.servlet;


import com.ffms.dao.impl.FamilyMemberDaoImpl;
import com.ffms.entity.FamilyMember;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

@WebServlet("/PreAddBankServlet")
//预添加银行账户界面
public class PreAddBankServlet extends HttpServlet {

    public void doGet(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        this.doPost(request, response);
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        FamilyMemberDaoImpl familyMemberDao = new FamilyMemberDaoImpl();
        List<FamilyMember> all = familyMemberDao.findAll();
        req.setAttribute("members", all);
        req.getRequestDispatcher("/admin/bankAdd.jsp").forward(req, resp);

    }
}
